﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Person : Opreation
    {
        public void suiji()
        {
            int Num2 = Opper2();
            int Num = Rannum();
            Console.WriteLine("随机"+Num);
            Console.WriteLine("玩家"+Num2);
            if (Num2 == Num)
            {
                Console.WriteLine("平局");
            }
            if (Num2 > Num & Num2 == Num + 1)
            {
                Console.WriteLine("胜利");
            }
            if (Num2 < Num & Num2 == Num - 1)
            {
                Console.WriteLine("失败");
            }
        }
        public int[] Draw()
        {
            int draw = 0;
            int defeat = 0;
            int victory = 0;
            for (int i = 0; i < 1000; i++)
            {
                if (Num2 == Num)
                {
                    draw++;
                    break;
                }
                if (Num2 > Num & Num2 == Num + 1)
                {
                    victory++;
                    break;
                }
                if (Num2 < Num & Num2 == Num - 1)
                {
                    defeat++;
                    break;
                } 
            }
            int[] arr = new int[] { draw, victory, defeat };
            return arr;
        }
        public void Score()
        {
            Console.WriteLine("平局："+Draw()[0]);
            Console.WriteLine("胜利："+Draw()[1]);
            Console.WriteLine("失败："+Draw()[2]);
        }
    }
}